﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Include/Admin.master" AutoEventWireup="true"
    CodeFile="Manage.aspx.cs" Inherits="Admin_AdminRole_Manage" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <ajaxToolkit:ToolkitScriptManager runat="Server" EnableScriptGlobalization="true"
        EnableScriptLocalization="true" ID="ScriptManager1" />
    <table cellspacing="0" cellpadding="0" style="width: 100%; height: 30px; padding-bottom: 5px;
        border: 1px; border-color: #66CCFF;">
        <tr style="background-image: url('../../images/管理员页面/title_bg1.jpg'); background-repeat: repeat-x;">
            <td style="font-weight: bold; font-size: large; font-family: 仿宋;">
                <strong>【管理员角色管理】</strong>
            </td>
        </tr>
    </table>
    <table class="editTable" cellspacing="1">
        <tr>
            <th>
                关键字
            </th>
            <td>
                <asp:TextBox ID="txtKey" runat="server"></asp:TextBox>
            </td>
            <td>
                <asp:Button ID="btnSearch" runat="server" Text="搜索" OnClick="btnSearch_Click" />
            </td>
        </tr>
    </table>
    <asp:ListView ID="lvAdminRole" runat="server" DataKeyNames="ID" OnItemCanceling="lvAdminRole_ItemCanceling"
        OnItemDeleting="lvAdminRole_ItemDeleting" OnItemEditing="lvAdminRole_ItemEditing"
        OnItemUpdating="lvAdminRole_ItemUpdating">
        <LayoutTemplate>
            <table class="editTable" cellspacing="1">
                <tr>
                    <th>
                        角色名称
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
                <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
            </table>
        </LayoutTemplate>
        <ItemTemplate>
            <tr>
                <td>
                    <%# Eval("RoleName")%>
                </td>
                <td>
                    <asp:LinkButton ID="lbtnEdit" runat="server" CommandName="Edit" Text="修改"></asp:LinkButton>&nbsp;&nbsp;
                    <asp:LinkButton ID="lbtnDelete" runat="server" Text="删除" OnClientClick="return confirm('您确定要删除该项吗?');"
                        CommandName="Delete"></asp:LinkButton>
                </td>
            </tr>
        </ItemTemplate>
        <EditItemTemplate>
            <tr>
                <td>
                    <asp:TextBox ID="txtEdiName" runat="server" Text='<%#Eval("RoleName")%>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvEditName" runat="server" Display="Static" ErrorMessage="请输入角色名称"
                        ControlToValidate="txtEdiName" ValidationGroup="Update"></asp:RequiredFieldValidator>
                </td>
                <td style="width: 130px">
                    <asp:LinkButton ID="lbtnCancel" runat="server" Text="取消" CommandName="Cancel"></asp:LinkButton>&nbsp;&nbsp;
                    <asp:LinkButton ID="lbtnUpdate" runat="server" Text="更新" CommandName="Update" ValidationGroup="Update"></asp:LinkButton>
                </td>
            </tr>
        </EditItemTemplate>
        <EmptyDataTemplate>
            没有数据<br />
            <br />
        </EmptyDataTemplate>
    </asp:ListView>
    <br />
    <br />
    <asp:HyperLink ID="lnkAdd" runat="server" Text="添加管理员角色" ForeColor="Blue"></asp:HyperLink>
    <asp:Panel ID="pnlAdd" runat="server"  CssClass="addPnl"  >
        <h2>
            添加管理员角色
        </h2>
        <p>
            请完成下面的内容:
        </p>
        <table cellspacing="1">
            <tr>
                <th>
                    <span class="red">*</span>角色名称
                </th>
                <td>
                    <asp:TextBox ID="txtAddName" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvAddName" runat="server" Display="Static" ErrorMessage="请输入用户名"
                        ControlToValidate="txtAddName" ValidationGroup="ClientAddGroup"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <asp:Button ID="btnAdd" runat="server" Text="添加" ValidationGroup="ClientAddGroup" OnClick="btnAdd_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <ajaxToolkit:PopupControlExtender ID="PopUpExtender" runat="server" TargetControlID="lnkAdd"
        PopupControlID="pnlAdd" Position="Bottom">
    </ajaxToolkit:PopupControlExtender>
</asp:Content>
